<template>
  <div class="question-content text-[14px] px-4">
    <div class="loading-container" v-if="isLoadingQuestion">
      <van-loading />
      <div>正在分析内容,生成面试题...</div>
    </div>
    <div v-else>
      <van-empty description="简历不存在,无法生成问题" v-if="!cp_fileUrl" />
      <markdown v-else :content="questionList" />
    </div>
  </div>
</template>

<script setup>
import { computed } from "vue";
import { useInterviewStore } from "@/store";
import markdown from "@/components/markdown.vue";

const interviewStore = useInterviewStore();

const cp_fileUrl = computed(() => interviewStore.sharePath);

const isLoadingQuestion = computed(() => interviewStore.isLoadingQuestion);

const questionList = computed(() => {
  if (!interviewStore.questions) return ''
  return interviewStore.questions;
});
</script>

<style scoped lang="less">
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 300px;
   
  div {
    margin-top: 10px;
  }
}
</style>
